package cn.bdqn.hospital.utils;

import com.alibaba.fastjson.JSONObject;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class PrintUtils {
    public static void print(HttpServletResponse resp,Object obj) throws IOException {
        resp.setContentType("application/json;charset=UTF-8");
        PrintWriter out = resp.getWriter();
        out.print(JSONObject.toJSONString(obj));
        out.flush();
        out.close();
    }
}
